﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using FTBS.Models.DAO;
using FTBS.Models.Entities.Concert;

namespace FTBS.Models.BLO
{
    public class ReportBLO
    {
        private ReportDAO reportDAO = new ReportDAO();

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public List<string> GetSuppliers() {
            List<string> suppliers = new List<string>();
            suppliers = reportDAO.GetAllSuppliers();
            return suppliers;
        }
        
        #region supplier report
        //=========================================New=============================================================
        /// <summary>
        /// 
        /// </summary>
        /// <param name="usn"></param>
        /// <param name="fTime"></param>
        /// <param name="tTime"></param>
        /// <returns></returns>
        public List<ReportTube> GetSupplierTimeRangeData(string usn, DateTime fTime, DateTime tTime) {
            return reportDAO.GetSupplierTimeRangeData(usn, fTime, tTime);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="usn"></param>
        /// <param name="fTime"></param>
        /// <param name="tTime"></param>
        /// <returns></returns>
        public List<ReportTube> GetSupplierCategoriesRank(string usn, DateTime fTime, DateTime tTime)
        {
            return reportDAO.GetSupplierCategoriesRank(usn, fTime, tTime);
        }
        #endregion

        #region Admin report
        //=============================================New==================================================
        /// <summary>
        /// 
        /// </summary>
        /// <param name="fTime"></param>
        /// <param name="tTime"></param>
        /// <returns></returns>
        public List<ReportTube> GetSystemSuppliersTimeRangeData(DateTime fTime, DateTime tTime)
        {
            List<ReportTube> data = reportDAO.GetSystemSuppliersTimeRangeData(fTime, tTime);
            return data;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="fTime"></param>
        /// <param name="tTime"></param>
        /// <returns></returns>
        public List<ReportTube> GetSystemTheatersTimeRangeData(DateTime fTime, DateTime tTime)
        {
            return reportDAO.GetSystemTheatersTimeRangeData(fTime, tTime);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="fTime"></param>
        /// <param name="tTime"></param>
        /// <returns></returns>
        public List<ReportTube> GetSystemSuppliersTimeRangeSoldData(DateTime fTime, DateTime tTime)
        {
            return reportDAO.GetSystemSuppliersTimeRangeSoldData(fTime, tTime);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="fTime"></param>
        /// <param name="tTime"></param>
        /// <returns></returns>
        public List<ReportTube> GetSystemTheatersTimeRangeSoldData(DateTime fTime, DateTime tTime)
        {
            return reportDAO.GetSystemTheatersTimeRangeSoldData(fTime, tTime);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="usn"></param>
        /// <param name="fTime"></param>
        /// <param name="tTime"></param>
        /// <returns></returns>
        public List<ReportTube> GetSupplierTheatersTimeRangeSoldData(string usn, DateTime fTime, DateTime tTime) {
            return reportDAO.GetSupplierTheatersTimeRangeSoldData(usn, fTime, tTime);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="fTime"></param>
        /// <param name="tTime"></param>
        /// <returns></returns>
        public List<ReportTube> GetSystemCategoriesRank(DateTime fTime, DateTime tTime)
        {
            return reportDAO.GetSystemCategoriesRank(fTime, tTime);        
        }
        
        #endregion


        /// <summary>
        /// Get histtory data of a theater
        /// </summary>
        /// <param name="usn"></param>
        /// <param name="fTime"></param>
        /// <param name="tTime"></param>
        /// <returns></returns>
        public List<ReportTube> GetATheaterData(int theaterId, DateTime fTime, DateTime tTime)
        {
            return reportDAO.GetATheaterSoldData(theaterId, fTime, tTime);
        }

    }
}